<template>
  <el-container>
    <el-aside>
      <el-row>
        <el-col>
          <div>智能水务管理系统</div>
          <MenuView></MenuView>
        </el-col>
      </el-row>
    </el-aside>
    <el-container>
      <el-header>
        <UserInfo></UserInfo>
        <NavHeader></NavHeader>
      </el-header>
      <el-main>
        <transition name="el-zoom-in-center">
          <!-- :include="[缓存的组件的name选项的值]" -->
          <keep-alive :include="['SiteView']" :max="20">
            <!-- :exclude="['不缓存组件的name选项的值'] -->
            <!-- <keep-alive :exclude="['KHLXGL']"> -->
            <router-view></router-view>
          </keep-alive>
        </transition>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import MenuView from "./../meun/index.vue"
import UserInfo from "@/components/header/UserInfo.vue"
import NavHeader from "@/components/header/NavHeader.vue"

export default {
  name: 'DEMOHomeView',

  data() {
    return {

    };
  },

  components: {
    MenuView, UserInfo, NavHeader
  },

  methods: {

  },
  beforeCreate() {
    console.log("home beforeCreat:");
  },
  created() {
    console.log("home created:");
  },
  beforeRouteEnter(to, from, next) {
    console.log("beforeRouteEnter next之前", this); // beforeCreate（）之前执行 this=》undefined
    next(aa => {
      // 组件mouted 创建后执行next中的回调函数。
      console.log("hoem beforeRouteEnter:", aa);
    })
  }
};
</script>

<style lang="less" scoped>
/deep/ .el-header {
  height: auto !important;
}
</style>